﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text;
using System.Collections.ObjectModel;
using AssessmentTool.Services.DTO;
using AdminApplication.PresentationLogic.EventArguments;
using System.IO;

namespace AdminApplication.PresentationLogic
{
    public class CSVProfiliBuilder
    {
        public static StringBuilder getCSVProfilo(Collection<UtenteProfiliDTO> dtos)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("USERNAME;PROFILO;PERCENTUALE DI PROSSIMITA");
            sb.Append(Environment.NewLine);
            foreach (UtenteProfiliDTO dto in dtos)
            {

                
                foreach (ProfiliDTO profilo in dto.profili)
                {
                    sb.Append(dto.utente.Username);
                    sb.Append(";");
                    sb.Append(profilo.NomeProfilo);
                    sb.Append(";");
                    sb.Append((int)profilo.PercentualeProssimita);
                    sb.Append(";");
                    sb.Append(Environment.NewLine);
                }
                
            }
            return sb;
        }
    }
}
